package com.springcloudalibaba.rabbitmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.support.RocketMQHeaders;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Service;

/**
 * @Author: TongRui乀
 * @Date: 2019-12-09 16:05
 * @description：
 */
@RocketMQMessageListener(topic = "test_topic", consumerGroup = "test_group")
@Service
public class RocketConsumer {



    @StreamListener("input")
    public void receive(Message message){

        System.err.println("收到消息：" + message.getPayload());

        System.err.println("Header " + message.getHeaders().get(RocketMQHeaders.TAGS));
    }

}
